<%-- 
    Document   : adminOffers
    Created on : 7 déc. 2011, 17:45:28
    Author     : Gaëtan
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>

<h2 id="header"><s:property value="%{getText('offer.tab.title')}" /></h2>
<table class="csstable">    
  
    <tr id="top">
        <th><s:property value="%{getText('offer.id')}" /></th>
        <th><s:property value="%{getText('offer.date')}" /></th>
        <th><s:property value="%{getText('offer.titre')}" /></th>
        <th><s:property value="%{getText('offer.entreprise')}" /></th>
        <th><s:property value="%{getText('offer.ville')}" /></th>
    </tr>
    <s:iterator value="offersList">

        <tr id="cel">
            <td><s:property value="id"/></td>
            <td><s:text name="date.format">
                    <s:param value="dateEnvoi.toGregorianCalendar().getTime()"/>
                </s:text></td>
            <td><a href="offerAdmin.action?id=${id}&back=<s:property value="back" />"><s:property value="titre"/></a></td>
            <td><s:property value="entreprise"/></td>
            <td><s:property value="ville"/></td>
            <s:if test="%{#admin == true}">
                <td>
                    <s:form method="post" action="editOfferAdmin" theme="simple">
                        <s:hidden name="id" />
                        <s:submit type="image" src="images/edit.gif" label="%{getText('offer.edit')}" title="%{getText('offer.edit')}" />
                    </s:form>
                </td>
                <td>
                    <s:form method="post" action="deleteOfferAdmin" theme="simple">
                        <s:hidden name="id" />
                        <s:submit type="image" src="images/supprimer.jpg" label="%{getText('offer.delete')}" title="%{getText('offer.delete')}" />
                    </s:form>
                </td>
            </s:if>
            <s:if test="file!=\"\"">
                <td>
                    <a href="downloadPdf.action?id=${id}" target="_blank"><img src="images/pdf.jpg" title="<s:property value="%{getText('offer.pdf')}" />" alt="<s:property value="%{getText('offer.pdf')}" />" /></a>
                </td>
            </s:if>
            <s:else>
                <td></td>
            </s:else>
            <s:if test="%{#admin == false}">
                <td>
                    <s:form method="post" action="applyOffer" theme="simple">
                        <s:hidden name="id" />
                        <s:submit value="%{getText('offer.apply.submit')}" />
                    </s:form>
                </td>
            </s:if>
        </tr>
    </s:iterator>

</table>

